package com.wuxiaofan.member.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.member.entity.MemberStatisticsInfo;
import com.wuxiaofan.member.entity.custom.MemberStatisticsInfoCustom;
import com.wuxiaofan.member.mapper.MemberStatisticsInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.member.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class MemberStatisticsInfoService {
    @Autowired
    private MemberStatisticsInfoMapper umsMemberStatisticsInfoMapper;
    @Resource
    private Idgenerator idgenerator;
    public MemberStatisticsInfo findById(String id){
        return umsMemberStatisticsInfoMapper.selectById(id);
    }

    public MemberStatisticsInfoCustom findCountByMap(Map paraMap){
        return umsMemberStatisticsInfoMapper.findCountByMap(paraMap);
    }

    public MemberStatisticsInfoCustom findGroupByMap(Map paraMap){
        return umsMemberStatisticsInfoMapper.findGroupByMap(paraMap);
    }

    public List<MemberStatisticsInfoCustom> findByMap(Map paraMap){
        return umsMemberStatisticsInfoMapper.findByMap(paraMap);
    }

    public Page<MemberStatisticsInfoCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(umsMemberStatisticsInfoMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        umsMemberStatisticsInfoMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        umsMemberStatisticsInfoMapper.deleteById(id);
    }

    public MemberStatisticsInfo save(MemberStatisticsInfo umsMemberStatisticsInfo){
        umsMemberStatisticsInfo.setId(idgenerator.getId());
        umsMemberStatisticsInfoMapper.insert(umsMemberStatisticsInfo);
        return umsMemberStatisticsInfo;
    }

}
